<%= form_for @log, :url => {:action => @action } do |f| %>
<table>
<%= hidden_field_tag "log[region_id]", @region.id %>
<%= hidden_field_tag "log[schedule_id]", @log.schedule.nil? ? nil : @log.schedule.id  %>
<tr><td>Date<td><%= f.date_select :when %>
<tr><td>Volunteer<td><%= f.select(:volunteer_id, Volunteer.all.collect{ |v| (v.region_ids.include? @region.id) ? v : nil }.compact.collect{ |v| [v.name,v.id] },{:include_blank => true}) %>
<tr><td>Donor<td><%= f.select(:donor_id, Location.where("is_donor AND region_id = ?",@region.id).collect{ |l| [l.name,l.id] },{:include_blank => true}) %>
<tr><td>Recipient<td><%= f.select(:recipient_id, Location.where("NOT is_donor AND region_id = ?",@region.id).collect{ |l| [l.name,l.id] },{:include_blank => true}) %>
<tr><td>Food Type<td><%= f.select(:food_type_id, FoodType.all.collect{ |ft| [ft.name,ft.id] },{:include_blank => true}) %>
<tr><td>Weight (lbs)<br><span class="subtext">e.g., 42. Put a 0 if the pick-up didn't happen for some reason.</span><td><%= f.text_field(:weight) %>

<tr><td>Weighed With<td><%= f.select(:weighed_by, [["Bathroom Scale","Bathroom Scale"],["Floor Scale","Floor Scale"],["Guesstimate","Guesstimate"]],{:include_blank => true}) %>
<tr><td>Description Of Food<br>
        <span class="subtext">e.g., pears, apples, mangos, celery</span><td><%= f.text_area(:description, :size => "30x6") %>
<tr><td>Transported With<td><%= f.select(:transport_type_id, TransportType.all.collect{ |tt| [tt.name,tt.id] },{:include_blank => true}) %>
<tr><td>Notes<br>
<span class="subtext">Something to report? Any problems? e.g., trailer<br>in need of repair, issues with the scale, busted bin.<td><%= f.text_area(:notes, :size => "30x6") %>
<tr><td>Flag For Admin<br>
<span class="subtext">Check this if you want to make sure someone reads this.</span><td><%= f.check_box(:flag_for_admin) %>
<tr><td>Original Volunteer<br><span class="subtext">The person originally scheduled to do<br>this shift, if you are covering it.<td><%= f.select(:orig_volunteer_id, Volunteer.all.collect{ |v| (v.region_ids.include? @region.id) ? v : nil }.compact.collect{ |v| [v.name,v.id] },{:include_blank => true}) %>
</table>
<%= submit_tag %>
<% end %>
